/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.srcptit.trainning.huongpq.btvn2;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author Admin_Pro
 */
public class Bai5 {

    public static void main(String[] args) {
        File f = new File("bai 5.txt");
        try {
            f.createNewFile();
            FileReader fr = new FileReader(f);
            BufferedReader br = new BufferedReader(fr);
            String a;
            try {
                a = br.readLine();
                long t[] = new long[6];
                for (int i = 0; i < 6; i++) {
                    t[i] = 0;
                }
                for (int i = 0; i < a.length(); i++) {
                    if (a.charAt(i) == 'a') {
                        t[0]++;
                    } else if (a.charAt(i) == 'A') {
                        t[1]++;
                    } else if (a.charAt(i) == 'b') {
                        t[2]++;
                    } else if (a.charAt(i) == 'B') {
                        t[3]++;
                    } else if (a.charAt(i) == 'c') {
                        t[4]++;
                    } else if (a.charAt(i) == 'C') {
                        t[5]++;
                    }
                }
                System.out.println("so a + A: " + (t[0] + t[1]));

                System.out.println("so a: " + t[0]);

                System.out.println("so A: " + t[1]);

                System.out.println("so b + B: " + (t[2] + t[3]));

                System.out.println("so b: " + t[2]);

                System.out.println("so B: " + t[3]);

                System.out.println("so c + C: " + (t[4] + t[5]));

                System.out.println("so c: " + t[4]);

                System.out.println("so C: " + t[5]);

            } catch (Exception e) {
                System.out.println("loi: " + e);
            }

        } catch (IOException ex) {
            Logger.getLogger(Bai5.class.getName()).log(Level.SEVERE, null, ex);
        }

    }
}
